package com.prabhakar.demo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class DrawingClass {

	public static void main(String[] args) {
		

		/*BeanFactory factory =  new XmlBeanFactory(new FileSystemResource("mySpring.xml"));
		Rectangle rect = (Rectangle)factory.getBean("rectangle");
		rect.draw();
		
		Square square = (Square)factory.getBean("square");
		square.draw();*/
		
		ApplicationContext context = new ClassPathXmlApplicationContext("mySpring.xml");
		Rectangle rect = (Rectangle)context.getBean("rectangle");
		rect.draw();
		
		Square square = (Square)context.getBean("square");
		square.draw();
	}
	
}
